# -*- coding:utf-8 *-
# 项目       :    monkeytest（kika） 
# 文件       :    logcat_run.py
# 作者       :    zhangchen 
# 时间       :    2021/3/11  11:28 上午 
# IDE       :    PyCharm
import subprocess
import os
import sys
class logcats:
    def __init__(self):
        # logcat = subprocess.Popen(["adb", "logcat"], stdout=subprocess.PIPE)
        # while not logcat.poll():
        #     line = logcat.stdout.readline()
        #     if line:
        #         print(line)  # your logic
        #     else:
        #         break
        # print("Return code", logcat.returncode)
        #
        # logcat.kill()  # kill logcat process if needed
        ps = subprocess.Popen('adb logcat -v time', stdin=subprocess.PIPE, stdout=subprocess.PIPE, shell=True)
        for line in ps.stdout:
            print(line)

